Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documents: Add support for URL-specific document variations - refs #5956 #5976

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

christianbeeznest
Copy link
Contributor

No description provided.

@@ -0,0 +1,71 @@
<?php

declare(strict_types=1);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a single space around assignment operators

use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class AddVariantResourceFileAction
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing class doc comment


class AddVariantResourceFileAction
{
public function __invoke(Request $request, EntityManagerInterface $em): ResourceFile
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

@@ -59,6 +63,7 @@ class ResourceController extends AbstractResourceController implements CourseCon
public function __construct(
private readonly UserHelper $userHelper,
private readonly ResourceNodeRepository $resourceNodeRepository,
private readonly ResourceFileRepository $resourceFileRepository
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 4 spaces, found 8

@@ -136,21 +141,55 @@
* View file of a resource node.
*/
#[Route('/{tool}/{type}/{id}/view', name: 'chamilo_core_resource_view', methods: ['GET'])]
public function view(Request $request, TrackEDownloadsRepository $trackEDownloadsRepository): Response
{
public function view(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must use "/**" style comments for a function comment

@@ -212,8 +251,12 @@ public function link(Request $request, RouterInterface $router, CLinkRepository
* Download file of a resource node.
*/
#[Route('/{tool}/{type}/{id}/download', name: 'chamilo_core_resource_download', methods: ['GET'])]
public function download(Request $request, TrackEDownloadsRepository $trackEDownloadsRepository): Response
{
public function download(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must use "/**" style comments for a function comment

@@ -458,15 +520,46 @@
return new Response(null, Response::HTTP_NO_CONTENT);
}

private function processFile(Request $request, ResourceNode $resourceNode, string $mode = 'show', string $filter = '', ?array $allUserInfo = null): mixed
#[Route('/resource_files/{resourceNodeId}/variants', name: 'chamilo_core_resource_files_variants', methods: ['GET'])]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

@@ -458,15 +520,46 @@
return new Response(null, Response::HTTP_NO_CONTENT);
}

private function processFile(Request $request, ResourceNode $resourceNode, string $mode = 'show', string $filter = '', ?array $allUserInfo = null): mixed
#[Route('/resource_files/{resourceNodeId}/variants', name: 'chamilo_core_resource_files_variants', methods: ['GET'])]
public function getVariants(string $resourceNodeId, EntityManagerInterface $em): JsonResponse
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must use "/**" style comments for a function comment

@@ -150,6 +183,11 @@ class ResourceFile implements Stringable
#[ORM\Column(type: 'datetime')]
protected $updatedAt;

#[ORM\ManyToOne(targetEntity: AccessUrl::class)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

@@ -150,6 +183,11 @@
#[ORM\Column(type: 'datetime')]
protected $updatedAt;

#[ORM\ManyToOne(targetEntity: AccessUrl::class)]
#[ORM\JoinColumn(name: 'access_url_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

return $this->json($data);
}

#[Route('/resource_files/{id}/delete_variant', methods: ['DELETE'], name: 'chamilo_core_resource_files_delete_variant')]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

}

#[Route('/resource_files/{id}/delete_variant', methods: ['DELETE'], name: 'chamilo_core_resource_files_delete_variant')]
public function deleteVariant(int $id, EntityManagerInterface $em): JsonResponse
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must use "/**" style comments for a function comment

@@ -150,6 +183,11 @@ class ResourceFile implements Stringable
#[ORM\Column(type: 'datetime')]
protected $updatedAt;

#[ORM\ManyToOne(targetEntity: AccessUrl::class)]
#[ORM\JoinColumn(name: 'access_url_id', referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
protected ?AccessUrl $accessUrl = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

@@ -332,6 +370,17 @@
return $this;
}

public function getAccessUrl(): ?AccessUrl
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line indented incorrectly; expected 8 spaces, found 4

@@ -332,6 +370,17 @@
return $this;
}

public function getAccessUrl(): ?AccessUrl
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing function doc comment

Copy link

codeclimate bot commented Jan 4, 2025

Code Climate has analyzed commit 2fc1932 and detected 39 issues on this pull request.

Here's the issue category breakdown:

Category Count
Style 36
Clarity 3

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant